package cn.lbwfree.day3_16;

import java.util.Scanner;

/**
 * @date:2020年3月16日
 * @author:lbwfree
 */
public class Max_min_sum {
	public static void main(String[] args) {
		Scanner iScanner = new Scanner(System.in);
		int num=iScanner.nextInt();
		int[] arrays= new int[num];
		for (int i = 0; i < arrays.length; i++) {
			arrays[i]=iScanner.nextInt();
		}
		int Max=Integer.MIN_VALUE;
		int Min=Integer.MAX_VALUE;
		int sum=0;
		for (int i = 0; i < arrays.length; i++) {
			Max=Max>=arrays[i]?Max:arrays[i];
			Min=Min<=arrays[i]?Min:arrays[i];
			sum += arrays[i];
		}
		System.out.println(Max);
		System.out.println(Min);
		System.out.println(sum);
	}

}
